<?php
namespace Home\Controller;
/**
 * 我的福利
 * @author Administrator
 *
 */
class PacketController extends HomeBaseController
{
    public function index(){
            $arry=array('uid' => session('uid'));
            if(I('status',0) !=0){
                $arry['status'] = I('status',0);
            };
            $count = D('UserPacket')->count_userPackets($arry);
            $userPackets = D('UserPacket')->get_userPackets($arry);
            $this->assign('packetList', $userPackets);
            $this->assign('count', $count);
            $this->assign('status', I('post.status',0));
            $this->display('packet/index');
    }
    
    
    public function getCount(){
        $resp['count']=0;
        $arry=array('uid' => session('uid'));
        $count = D('UserPacket')->count_userPackets($arry);
        $resp['count']=$count;
        $this->ajaxReturn($resp,'JSON');
    }
}